home *** CD-ROM | disk | FTP | other *** search
/ Games of Daze / Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso / x2ftp / msdos / libs / knowhow4 / print.h < prev    next >
C/C++ Source or Header  |  1994-10-10  |  2KB  |  58 lines

  1. /* PrintManager is the class, which may send buffer of GrafBuffer class
  2.    to printers of different types. The algorithm is: load "bound", print it,
  3.    load next...
  4. */
  5.  
  6. #ifndef __PRINT_MANAGER_
  7. #define __PRINT_MANAGER_
  8.  
  9. #include "gbuf.h"
  10. #include "image.h"
  11.  
  12. #define MAXPAGE 2000    // maximum page width
  13.  
  14. enum { EPSON9 = 1, EPSON24, LASERJET_II };
  15. enum { DD, QD, LJ_100, LJ_150 };  // print density
  16. enum { PAPER_OFF = '8', PAPER_ON = '9' };
  17.  
  18. class PrintManager
  19.     {
  20.     protected:
  21.     int printer_type;      // see enum of printer types
  22.     int density;           // double or quadruple
  23.     int pass;              // how much time to repeate each pass
  24.     int mx, my, dx, dy;    // print time deformation
  25.     int left;              // left indent
  26.     int paper;             // paper-out sensor disable
  27.     int parity;            // minimal number of lines in bound (* 4 for color)
  28.     public:
  29.     PrintManager(int t, int d, int p = 1,
  30.         rect cmp = rect(1, 1, 1, 1),
  31.         int lt = 0, int ppr = PAPER_ON, int pa = 1)
  32.         { printer_type = t; density = d; pass = p;
  33.           mx = cmp.origin.X; my = cmp.origin.Y;
  34.           dx = cmp.corner.X; dy = cmp.corner.Y;
  35.           left = lt; paper = ppr; parity = pa; }
  36.  
  37.     void set_type(int t) { printer_type = t; }
  38.     void set_density(int d) { density = d; }
  39.     void set_pass(int p) { pass = p; }
  40.     void set_comp(int multx, int multy, int divx, int divy)
  41.         { mx = multx; my = multy; dx = divx; dy = divy; }
  42.     void set_left(int l) { left = l; }
  43.     void set_paper(int p) {paper = p; }
  44.  
  45.     void init_printer(int size, int sh);    // set current resolution and so on
  46.     void draw_string(char* str);  // draws graphic string
  47.     void draw_image(imageP image); // print image
  48.     void draw_buffer(GrafBuffer* buf);  // prints buffer
  49.  
  50.     void draw_pages(GrafBuffer* buf, char* work_name,
  51.             int maxpage = MAXPAGE);
  52.                      // print using page of maxpage width
  53.     void print_part(rect src, GrafBuffer* buf, char* work_name);
  54.     friend class GrafBuffer;
  55.     };
  56.  
  57. #endif __PRINT_MANAGER_
  58.